<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <title>导出项目</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" type="text/css" href="./ext/bootstrap/css/bootstrap.min.css" >
    <link rel="stylesheet" type="text/css" href="./ext/bootstrap-table/dist/bootstrap-table.min.css" >
    <link href="./ext/bootstrap-formvalidation/dist/css/formValidation.min.css" rel="stylesheet">
    <link rel="stylesheet" href="./ext/bootstrap-select/dist1.12.4/css/bootstrap-select.min.css">
    <link rel="stylesheet" href="./css/index.css">
        <!-- 设置缓存过期时间 2小时 -->
    <meta http-equiv="expires" content="7200" >
     <!-- 外链图片 -->
    <meta name="referrer" content="no-referrer" />
    <script type="text/javascript" src="ext/bootstrap/jquery/jquery3.2.1.js"></script>
    <script type="text/javascript" src="ext/bootstrap/js/bootstrap.min.js"></script>
    <!-- 引入table相关 js -->
    <script type="text/javascript" src="ext/bootstrap-table/dist/bootstrap-table.min.js"></script>
    <script type="text/javascript" src="ext/bootstrap-table/dist/locale/bootstrap-table-zh-CN.min.js"></script>
    <script type="text/javascript" src="ext/bootstrap-table/dist/extensions/defer-url/bootstrap-table-defer-url.js"></script>
    <!-- 引入bootbox相关 js -->
    <script src="ext/boot-box/bootbox.min.js"></script>
    <script src="ext/boot-box/bootbox.locales.min.js"></script>
    <!-- 序列化json -->
    <script src="ext/bootstrap/jquery/jquery.serializejson.min.js"></script>
    <!-- 引入表单校验个相关 js -->
    <script type="text/javascript" src="ext/bootstrap-formvalidation/dist/js/formValidation.js"></script>
    <script type="text/javascript" src="ext/bootstrap-formvalidation/dist/js/framework/bootstrap.js"></script>
    <script type="text/javascript" src="ext/bootstrap-formvalidation/dist/js/language/zh_CN.js"></script>
    <!-- 引入bootstrap-select相关 js -->
    <script src="ext/bootstrap-select/dist1.12.4/js/bootstrap-select.min.js"></script>
    <!-- 引入echarts相关 js -->
    <script src="ext/echarts/echarts.min.js"></script>
    <style>
        /**设置disabdlen按钮背景色*/
        .btn.form-control[disabled]{
            background-color: #5cb85c;
            color: white;
        }
    </style>


</head>
<body>
<div class="wrap">
    <!-- 左边内容 -->
       <div id="left" class="left">
    <script type="text/javascript">
    </script>
     
        <div id="main-top" >
            <p id="main-user" >欢迎您:<span id="login-user"></span> &nbsp;&nbsp;
               <br> <button class="btn btn-xs btn-danger" id="logout">退 出</button>
            </p>
            <script type="text/javascript">
                // 判断是否登录
                user = window.localStorage.getItem("username")
                if (!user) {
                    location.href="login.html";
                }
                else {
                    document.getElementById("login-user").innerHTML = user || '-'
                }
                // 点注销，退出登录
                $('#logout').click(function(){
                    $.ajax({
                    type:'post',
                    url:'/api/logout',
                    contentType: "application/json",
                    dataType:'json',
                    beforeSend: function() {
                        // 发送请求，禁用提交按钮
                        $('#logout').attr('disabled', 'disabled');
                        },
                    complete: function () {
                        // 请求完成移除 disabled 属性
                        $('#logout').removeAttr('disabled');
                    },
                    success: function(result, status, xhr){
                        /** 删除账号
                        * localStorage.remove(user) 删除值
                        * localStorage.clear() 清空全部
                        */
                        window.localStorage.clear()
                        // 重定向到登录页
                        location.href="login.html";
                    }
                });
                })
            </script>
        </div>
        <div class="panel">
        <div class="panel-body">
            <span class="glyphicon glyphicon-cog" style="color: rgb(255, 140, 60);"></span>
            <a class="text-left" href="#">项目管理</a>
            <ul class="list-unstyled">
                <li><a class="text-left" href="add_project.html">新增项目</a></li>
                <li><a class="text-left" href="list_project.html">项目配置</a></li>
            </ul>
        </div>
        </div>
       
        <div class="panel">
            <div class="panel-body">
            <span class="glyphicon glyphicon-cog" style="color: rgb(255, 140, 60);"></span>
            <a class="text-left" href="#">用例管理</a>
            <ul class="list-unstyled">
                <li><a class="text-left" href="import_case.html">导入用例</a></li>
                <li><a class="text-left" href="add_api.html">新增 API</a></li>
                <li><a class="text-left" href="list_api.html">API 列表</a></li>
                <li><a class="text-left" href="add_case.html">新增用例</a></li>
                <li><a class="text-left" href="list_case.html">用例列表</a></li>
            </ul>
            </div>
        </div>
       
        <div class="panel">
            <div class="panel-body">
                <span class="glyphicon glyphicon-cog" style="color: rgb(255, 140, 60);"></span>
                <a class="text-left" href="#">测试计划</a>
                <ul class="list-unstyled">
                <li><a class="text-left" href="list_report.html">项目报告</a></li>
                <!-- <li><a class="text-left" href="add_plan.html">创建计划</a></li> -->
                <li><a class="text-left" href="list_myplan.html">我的计划</a></li>
                <li><a class="text-left" href="list_task.html">定时任务</a></li>
                <!-- <li><a class="text-left" href="export.html">导出项目</a></li> -->
                </ul>
            </div>
        </div>
        <div class="panel">
            <div class="panel-body">
                <span class="glyphicon glyphicon-cog" style="color: rgb(255, 140, 60);"></span>
                <a class="text-left"  href="#">学习交流</a>
                <ul class="list-unstyled">
                    <li><a class="text-left" target="_blank" href="https://gitee.com/yoyoketang/pytest-yaml-yoyo">yaml 用例教程</a></li>    
                <!-- <li><a class="text-left" target="_blank" href="https://tool.lu/crontab/">Cron在线语法</a></li> -->
                <li><a class="text-left" href="doc.html">联系我们</a></li>
                </ul>
            </div>
        </div>
    </div>

    <div id="right" class="container">
        <!-- 右边顶部导航 -->
        <div id="right-top">
    <ul class="nav nav-tabs">
        <li role="presentation" class="active"><a href="index.html">DashBoard</a></li>
        <li role="presentation"><a class="btn btn-info" href="list_report.html">查看报告</a></li>
        <li role="presentation"><a class="btn btn-success" href="list_task.html">定时任务</a></li>
        <li role="presentation"><a class="btn btn-success" href="export.html">导出用例</a></li>
    </ul>
</div>


        <!-- 右边编辑区域 -->
        <div class="row">
            <div class="col-xs-12, col-sm-12, col-md-12, col-lg-12">
                <div class="panel panel-success">
                    <div class="panel-heading">导出用例，只支持导出YAML格式用例</div>
                    <div class="panel-body">
                        <div class="row">
                            <div class="col-md-5">
                                <div class="panel panel-default">
                                    <div class="panel-heading">
                                        <h3>导出整个项目用例</h3>
                                    </div>
                                    <div class="panel-body">
                                        <form id="export-project"  action="/api/export" method="get" class="form-horizontal" role="form" >  
                                            <div class="form-group">
                                                
                                                <div class="col-sm-8 col-md-8">
                                                   <input type="hidden" id="export_type" name="export_type" class="form-control" value="project">
                                                </div>
                                            </div>
                                            <div class="form-group">
                                                 <label for="project_name" class="col-sm-3 col-md-3 control-label">选择项目:</label>
                                                 <div class="col-sm-8 col-md-8" >
                                                     <select id="project_name" name="export_id" class="form-control show-tick" data-live-search ="true" data-size="5" title="请选择">
                                                     </select>
                                                 </div>
                                             </div>
                                             <div class="form-group">
                                                 <label for="project_env" class="col-sm-3 col-md-3 control-label">运行环境:</label>
                                                 <div class="col-sm-8 col-md-8">
                                                    <input id="project_env" name="run_env" class="form-control">
                                                 </div>
                                             </div>
                                       
                                             <div class="form-group">
                                                 <div class="col-xs-12 col-sm-offset-3 col-sm-8 col-md-offset-3 col-md-5" >
                                                     <input id="project_btn" type="submit" class="form-control btn btn-success" value="点击提交">
                                                 </div>
                                             </div>
                                         </form> 
                                    </div>
                                </div>

                                
                            </div>
                            <div class="col-md-5">
                                <div class="panel panel-default">
                                    <div class="panel-heading">
                                        <h3>导出我的计划用例</h3>
                                    </div>
                                    <div class="panel-body">
                                        <form id="export-plan"  action="/api/export" method="get" class="form-horizontal" role="form" >  
                                            <div class="form-group">
                                                <div class="col-sm-8 col-md-8">
                                                   <input type="hidden" id="plan_type" name="export_type" class="form-control" value="plan">
                                                </div>
                                            </div>
                                            <div class="form-group">
                                                 <label for="plan_name" class="col-sm-3 col-md-3 control-label">选择计划:</label>
                                                 <div class="col-sm-8 col-md-8" >
                                                     <select id="plan_name" name="export_id" class="form-control show-tick" data-live-search ="true" data-size="5" title="请选择">
                                                     </select>
                                                 </div>
                                             </div>                   
                                             <div class="form-group">
                                                 <label for="plan_env_name" class="col-sm-3 col-md-3 control-label">运行环境:</label>
                                                 <div class="col-sm-8 col-md-8" >
                                                    <input id="plan_env_name" name="run_env" class="form-control">
                                                 </div>
                                             </div>
                                             <div class="form-group">
                                                 <div class="col-xs-12 col-sm-offset-3 col-sm-8 col-md-offset-3 col-md-5" >
                                                     <input id="plan_btn" type="submit" class="form-control btn btn-success" value="点击提交">
                                                 </div>
                                             </div>
                                         </form> 
                                    </div>
                                </div>                              
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript" src="js/export.js"></script>
</body>
</html>



